home *** CD-ROM | disk | FTP | other *** search
- Path: pub.news.uk.psi.net!usenet
- From: Matthew Towler <Matthew.Towler@unicam.co.uk>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Sorting a list
- Date: 21 Mar 1996 12:38:44 GMT
- Organization: PSINet UK Public Usenet Site
- Message-ID: <4irikk$kn4@pub.news.uk.psi.net>
- NNTP-Posting-Host: 193.122.53.13
-
- Avi Lev <avil@sapiens.com> writes:
- > Christopher Naas wrote:
- > >
- > > What's the absolutely fastest algorithm for sorting a List with around 1000
- > > items alphabetically?
- > >
- >
- > well, the fastest way is no doubt, bubble sort!!! but you have to perform the sort on a
- > list of pointers to the strings not on the strings themselves otherwise it'll be slower.
-
- How can bubble sort be quicker than quicksort. All both methods need is a function to
- compare two entries, and as quicksort makes far less comparisions than bubble sort it must
- be quicker. For 1000 entries it should be aproximately one hundred times faster (n^2 vs
- n log n time complexity). If you are using C, and have ANSI libraries, why not use the
- sort() function, then all the work is done for you already apart from the comparison
- routine.
-